function XmasTree2023_2
fig = figure('Units','normalized','Position',[.1,.1,.5,.8],'Color',[0,9,33]/255);
ax  = axes('Parent',fig,'Position',[0,-1/6,1,1+1/3],'UserData',[18,11,0,13,3,0,17,4,17]+97,...
      'XLim',[-5,5],'YLim',[-5,5],'ZLim',[-3,14],'Color',[0,9,33]/255,...
      'XColor','none','YColor','none','ZColor','none'); 
hold on; view(-47.5,33); disp(char(ax.UserData));
ax.DataAspectRatio=[1,1,1.2];
XMT = @(h,r,a,z) deal((h-z)./h.*r.*cos(a.*z), (h-z)./h.*r.*sin(a.*z), z);
OFS = @(x,y,z,p) deal(x+rand(size(x)).*p-p/2, y+rand(size(y)).*p-p/2, z+rand(size(z)).*p-p/2);


% 绘制圣诞树主体 ===========================================================
h = 10.05;
r = h/(1+sqrt(5));
[X,Y,Z] = XMT(h,r,100*pi,linspace(0,1,200)*h);
plot3(X,Y,Z,'Color',[76,103,86,250]./255,'LineWidth',1)

[X,Y,Z] = XMT(h,r,90*pi,linspace(0,1,50)*h);
[X,Y,Z] = OFS(X,Y,Z,.1);
scatter3(X,Y,Z,20,[213,194,100]./255,'filled','MarkerFaceAlpha',.9,'MarkerEdgeAlpha',.9)
scatter3(X,Y,Z,150,[213,194,100]./255,'filled','MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)


[X,Y,Z] = XMT(h,r,150*pi,linspace(0,1,50)*h);
[X,Y,Z] = OFS(X,Y,Z,.1);
scatter3(X,Y,Z,20,[114,146,184]./255,'filled','MarkerFaceAlpha',.9,'MarkerEdgeAlpha',.9)
scatter3(X,Y,Z,150,[114,146,184]./255,'filled','MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)


%% 绘制星星 ================================================================
plot3(0,0,10.5,'p', 'MarkerSize',25,'MarkerFaceColor',[255,223,153]/255,'MarkerEdgeColor','none','LineWidth', 1);
starLightHdl = scatter3(0,0,10.5,8000,'o','MarkerFaceColor','w','MarkerEdgeColor','w','MarkerEdgeAlpha',0,'MarkerFaceAlpha', 0.1);

%% 绘制地面 ================================================================
[X,Y]=meshgrid(linspace(-6,6,60));
Z=cos(hypot(X,Y).*5)./2-2; [X,Y,Z] = OFS(X,Y,Z,.1);
scatter3(X,Y,Z,3,'o','filled','CData',[91,131,253]./255,...
    'MarkerFaceAlpha',.4,'MarkerEdgeColor','none');
%% 绘制雪花 ================================================================
snowXYZ1=rand(120,3);
snowXYZ1(:,1:2)=snowXYZ1(:,1:2).*16-8;
snowXYZ1(:,3)=snowXYZ1(:,3).*20;
snowXYZ2=rand(150,3);
snowXYZ2(:,1:2)=snowXYZ2(:,1:2).*16-8;
snowXYZ2(:,3)=snowXYZ2(:,3).*20;
snowHdl1=plot3(snowXYZ1(:,1),snowXYZ1(:,2),snowXYZ1(:,3),'*','Color',[.8,.8,.8]);
snowHdl2=plot3(snowXYZ2(:,1),snowXYZ2(:,2),snowXYZ2(:,3),'.','Color',[.6,.6,.6]);
%% 旋转图像、雪花飘落 =======================================================
for i=1:1e8
    starLightHdl.SizeData=8000+sin(i/5).*1600;
    snowXYZ1(:,3)=snowXYZ1(:,3)-.05;snowXYZ2(:,3)=snowXYZ2(:,3)-.005;
    snowXYZ1(snowXYZ1(:,3)<0,3)=snowXYZ1(snowXYZ1(:,3)<0,3)+20;
    snowXYZ2(snowXYZ2(:,3)<0,3)=snowXYZ2(snowXYZ2(:,3)<0,3)+20;
    snowHdl1.XData=snowXYZ1(:,1);snowHdl1.YData=snowXYZ1(:,2);snowHdl1.ZData=snowXYZ1(:,3);
    snowHdl2.XData=snowXYZ2(:,1);snowHdl2.YData=snowXYZ2(:,2);snowHdl2.ZData=snowXYZ2(:,3);
    view([i,33]);
    drawnow;pause(.05)
end
end  